from django.contrib import admin  
from .models import UserInformationModel, EmailVerificationModel  


# 注册UserInformationModel到admin后台  
@admin.register(UserInformationModel)  
class UserInformationAdmin(admin.ModelAdmin):  
    list_display = ('username', 'nike_name', 'gender', 'birthday')  
    search_fields = ('username', 'nike_name', 'email')  
    readonly_fields = ('last_login', 'date_joined')  # 根据需要添加其他只读字段  
  
# 注册EmailVerificationModel到admin后台  
@admin.register(EmailVerificationModel)  
class EmailVerificationAdmin(admin.ModelAdmin):  
    list_display = ('code', 'email', 'send_type', 'send_time')  
    search_fields = ('code', 'email')  
    list_filter = ('send_type',)  # 允许在admin后台按send_type进行过滤  
